package com.zp.mvppractice.beans;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by izp on 2017/5/23.
 */

public class Product implements Parcelable {
    /**
     * product_model : 外带
     * user_id : 177
     * product_id : 291
     * product_unit :
     * product_size :
     * product_book :
     * user_createtime : 2017-05-18 13:35:59
     * company_id : null
     * product_price : 6
     * product_param :
     * product_label : [{"id":12,"name":"没事儿"}]
     * product_introduce :
     * product_picture :
     * product_code :
     * product_name : 酸辣粉
     */


    private Long user_id;
    private Long product_id;
    private Long company_id;
    private String product_unit;
    private String product_size;
    private String product_book;
    private String user_createtime;
    private String product_model;
    private String product_price;
    private String product_param;
    private String product_introduce;
    private String product_picture;
    private String product_code;
    private String product_name;
    private List<Label> product_label;

    public String getProduct_model() {
        return product_model;
    }

    public Product setProduct_model(String product_model) {
        this.product_model = product_model;
        return this;
    }

    public Long getUser_id() {
        return user_id;
    }

    public Product setUser_id(Long user_id) {
        this.user_id = user_id;
        return this;
    }

    public Long getProduct_id() {
        return product_id;
    }

    public Product setProduct_id(Long product_id) {
        this.product_id = product_id;
        return this;
    }

    public String getProduct_unit() {
        return product_unit;
    }

    public Product setProduct_unit(String product_unit) {
        this.product_unit = product_unit;
        return this;
    }

    public String getProduct_size() {
        return product_size;
    }

    public Product setProduct_size(String product_size) {
        this.product_size = product_size;
        return this;
    }

    public String getProduct_book() {
        return product_book;
    }

    public Product setProduct_book(String product_book) {
        this.product_book = product_book;
        return this;
    }

    public String getUser_createtime() {
        return user_createtime;
    }

    public Product setUser_createtime(String user_createtime) {
        this.user_createtime = user_createtime;
        return this;
    }

    public Object getCompany_id() {
        return company_id;
    }

    public Product setCompany_id(long company_id) {
        this.company_id = company_id;
        return this;
    }

    public String getProduct_price() {
        return product_price;
    }

    public Product setProduct_price(String product_price) {
        this.product_price = product_price;
        return this;
    }

    public String getProduct_param() {
        return product_param;
    }

    public Product setProduct_param(String product_param) {
        this.product_param = product_param;
        return this;
    }

    public String getProduct_introduce() {
        return product_introduce;
    }

    public Product setProduct_introduce(String product_introduce) {
        this.product_introduce = product_introduce;
        return this;
    }

    public String getProduct_picture() {
        return product_picture;
    }

    public Product setProduct_picture(String product_picture) {
        this.product_picture = product_picture;
        return this;
    }

    public String getProduct_code() {
        return product_code;
    }

    public Product setProduct_code(String product_code) {
        this.product_code = product_code;
        return this;
    }

    public String getProduct_name() {
        return product_name;
    }

    public Product setProduct_name(String product_name) {
        this.product_name = product_name;
        return this;
    }

    public List<Label> getProduct_label() {
        return product_label;
    }

    public Product setProduct_label(List<Label> product_label) {
        this.product_label = product_label;
        return this;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.product_model);
        dest.writeLong(this.user_id);
        dest.writeLong(this.product_id);
        dest.writeString(this.product_unit);
        dest.writeString(this.product_size);
        dest.writeString(this.product_book);
        dest.writeString(this.user_createtime);
        dest.writeLong(this.company_id);
        dest.writeString(this.product_price);
        dest.writeString(this.product_param);
        dest.writeString(this.product_introduce);
        dest.writeString(this.product_picture);
        dest.writeString(this.product_code);
        dest.writeString(this.product_name);
        dest.writeList(this.product_label);
    }

    public Product() {
    }

    protected Product(Parcel in) {
        this.product_model = in.readString();
        this.user_id = in.readLong();
        this.product_id = in.readLong();
        this.product_unit = in.readString();
        this.product_size = in.readString();
        this.product_book = in.readString();
        this.user_createtime = in.readString();
        this.company_id = in.readParcelable(Object.class.getClassLoader());
        this.product_price = in.readString();
        this.product_param = in.readString();
        this.product_introduce = in.readString();
        this.product_picture = in.readString();
        this.product_code = in.readString();
        this.product_name = in.readString();
        this.product_label = new ArrayList<Label>();
        in.readList(this.product_label, List.class.getClassLoader());
    }

    public static final Creator<Product> CREATOR = new Creator<Product>() {
        public Product createFromParcel(Parcel source) {
            return new Product(source);
        }

        public Product[] newArray(int size) {
            return new Product[size];
        }
    };
}
